s = input('Введите скобки:')
steck = []
s1 = ['(', '[', '{']
s2 = [')', ']', '}']

valid = True
for x in s:
    if x in s1:
        steck.append(x)
    elif x in s2:
        if not steck: 
            valid = False
            break
        elif (x == ')' and steck[-1] == '('):
            steck.pop()
        elif (x == ']' and steck[-1] == '['):
            steck.pop()
        elif (x == '}' and steck[-1] == '{'):
            steck.pop()
        else:
            valid = False
            break
            
if (valid == True) and not steck:
    print("True")
else:
    print("Fase")
        

